<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="urn:hl7-org:v3 ..\sdschemas\SDA.xsd">
    <#assign templateData={"title":"重性精神病患者随访服务", "code":"HSDB04.04", "templateId":"2.16.156.10011.2.1.1.15"}>
    <#include "fragment/header/header.ftl">
    <component>
        <structuredBody>
            <!--随访事件章节 -->
            <component>
                <section>
                    <code displayName="随访事件"/>
                    <entry>
                        <observation classCode="CASE" moodCode="EVN">
                            <!--重性精神疾病患者访到标志-->
                            <code code="DE05.10.124.00" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"
                                  displayName="重性精神疾病患者访到标志"/>
                            <value xsi:type="BL" value="${docData.suiFangSJ.huanZheFDBZ}"></value>
                        </observation>
                    </entry>
                </section>
            </component>
            <!--主要健康问题章节-->
            <component>
                <section>
                    <code code="11450-4" codeSystem="2.16.840.1.113883.6.1"
                          codeSystemName="LOINC" displayName="主要健康问题"/>
                    <text/>
                    <!--条目：危险性分级代码：对患者的危险性进行评估分级在特定编码体系中的代码
                    -->
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE05.10.077.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="危险性分级代码"/>
                            <value xsi:type="CD" code="${docData.zhuYaoJKWT.weiXianXFJ.code}"
                                   displayName="${docData.zhuYaoJKWT.weiXianXFJ.displayName}"
                                   codeSystem="2.16.156.10011.2.3.1.151"
                                   codeSystemName="重性精神疾病患者危险性分级代码表"></value>
                        </observation>
                    </entry>
                    <!-- 条目：精神症状代码-->
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE04.01.030.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="精神症状代码"/>
                            <value xsi:type="CD" code="${docData.zhuYaoJKWT.jingShenZZ.code}"
                                   displayName="${docData.zhuYaoJKWT.jingShenZZ.displayName}"
                                   codeSystem="2.16.156.10011.2.3.1.49" codeSystemName="精神症状代码表"></value>
                        </observation>
                    </entry>
                    <!--条目：自知力评价结果代码：对个体自知力缺失程度评价的结果在特定分类中的
                    代码-->
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE05.10.123.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="自知力评价结果代码"/>
                            <value xsi:type="CD" code="${docData.zhuYaoJKWT.ziZhiLPJJG.code}"
                                   displayName="${docData.zhuYaoJKWT.ziZhiLPJJG.displayName}"
                                   codeSystem="2.16.156.10011.2.3.2.32" codeSystemName="自知力评价结果代码表"></value>
                        </observation>
                    </entry>
                    <!-- 条目：睡眠状况：个体睡眠状况的描述-->
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE04.01.070.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="睡眠状况"/>
                            <value xsi:type="CD" code="${docData.zhuYaoJKWT.shuiMiaoQK.code}"
                                   displayName="${docData.zhuYaoJKWT.shuiMiaoQK.displayName}"
                                   codeSystem="2.16.156.10011.2.3.2.33"
                                   codeSystemName="睡眠情况代码表"></value>
                        </observation>
                    </entry>
                    <!-- 条目：随访饮食合理性评价类别代码：随访对象饮食合理性评价结果在特定分
                    类中的代码-->
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE03.00.080.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="随访饮食合理性评价类别代码"/>
                            <value xsi:type="CD" code="${docData.zhuYaoJKWT.yinShiHLXPJLB.code}"
                                   displayName="${docData.zhuYaoJKWT.yinShiHLXPJLB.displayName}"
                                   codeSystem="2.16.156.10011.2.3.2.34"
                                   codeSystemName="饮食情况代码表"></value>
                        </observation>
                    </entry>
                    <!-- 条目：社会功能情况分类代码-->
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE05.10.056.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="社会功能情况分类代码"/>
                            <value xsi:type="CD" code="${docData.zhuYaoJKWT.sheHuiGNQKFL.code}"
                                   displayName="${docData.zhuYaoJKWT.sheHuiGNQKFL.displayName}"
                                   codeSystem="2.16.156.10011.2.3.1.141" codeSystemName="重性精神疾病患者社会功能情况分类代码表"></value>
                        </observation>
                    </entry>
                    <!-- 条目：社会功能情况评价代码-->
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE05.10.057.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="社会功能情况评价代码"/>
                            <value xsi:type="CD" code="${docData.zhuYaoJKWT.sheHuiGNQKPJ.code}"
                                   displayName="${docData.zhuYaoJKWT.sheHuiGNQKPJ.displayName}"
                                   codeSystem="2.16.156.10011.2.3.2.35" codeSystemName="社会功能情况评价代码表"></value>
                        </observation>
                    </entry>
                    <!-- 条目：患病对家庭社会的影响类别代码-->
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE03.00.023.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="患病对家庭社会的影响类别代码"/>
                            <value xsi:type="CD" code="${docData.zhuYaoJKWT.huanBingSHYXLB.code}"
                                   displayName="${docData.zhuYaoJKWT.huanBingSHYXLB.displayName}"
                                   codeSystem="2.16.156.10011.2.3.1.24" codeSystemName="患重性精神疾病对家庭社会的影响代码表"></value>
                            <entryRelationship typeCode="COMP">
                                <!-- 条目：患病对家庭社会的影响次数-->
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE03.00.022.00" codeSystem="2.16.156.10011.2.2.1"
                                          codeSystemName="卫生信息数据元目录" displayName="患病对家庭社会的影响次数"/>
                                    <value xsi:type="INT" value="${docData.zhuYaoJKWT.huanBingSHYXCS}"></value>
                                </observation>
                            </entryRelationship>
                        </observation>
                    </entry>
                    <!-- 条目：关锁情况代码-->
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE03.00.017.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="关锁情况代码"/>
                            <value xsi:type="CD" code="${docData.zhuYaoJKWT.guanSuoQK.code}"
                                   displayName="${docData.zhuYaoJKWT.guanSuoQK.displayName}"
                                   codeSystem="2.16.156.10011.2.3.2.30"
                                   codeSystemName="关锁情况代码表"></value>
                        </observation>
                    </entry>
                </section>
            </component>
            <!--住院史章节-->
            <component>
                <section>
                    <code code="11336-5" codeSystem="2.16.840.1.113883.6.1" displayName="HISTORY OF HOSPITALIZATIONS"
                          codeSystemName="LOINC"/>
                    <text/>
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE02.10.091.00" displayName="住院情况"
                                  codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"/>
                            <effectiveTime value="${docData.zhuYuanShi.moCiZYSJ}"/>
                            <value xsi:type="CD" code="${docData.zhuYuanShi.zhuYuanQK.code}"
                                   displayName="${docData.zhuYuanShi.zhuYuanQK.displayName}"
                                   codeSystem="2.16.156.10011.2.3.2.36" codeSystemName="住院情况代码表"/>
                        </observation>
                    </entry>
                </section>
            </component>
            <!--实验室检查章节-->
            <component>
                <section>
                    <code code="30954-2" codeSystem="2.16.840.1.113883.6.1"
                          codeSystemName="LOINC" displayName="STUDIES SUMMARY"/>
                    <text/>
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE04.30.008.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="辅助检查标志"></code>
                            <value xsi:type="BL" value="${docData.shiYanSJC.fuZhuJCBZ}"></value>
                        </observation>
                    </entry>
                    <#if docData.shiYanSJC.fuZhuJCBZ=='true'>
                        <entry>
                            <organizer classCode="CLUSTER" moodCode="EVN">
                                <statusCode/>
                                <component>
                                    <observation classCode="OBS" moodCode="EVN">
                                        <code code="DE04.30.010.00" codeSystem="2.16.156.10011.2.2.1"
                                              codeSystemName="卫生信息数据元目录" displayName="辅助检查项目"></code>
                                        <!--检测日期-->
                                        <effectiveTime value="${docData.shiYanSJC.jianCeRQ}"></effectiveTime>
                                        <value xsi:type="ST">${docData.shiYanSJC.fuZhuJCXM}</value>
                                        <performer>
                                            <assignedEntity>
                                                <id/>
                                                <assignedPerson>
                                                    <name>${docData.shiYanSJC.fuZhuJCRYXM}</name>
                                                </assignedPerson>
                                            </assignedEntity>
                                        </performer>
                                    </observation>
                                </component>
                                <component>
                                    <observation classCode="OBS" moodCode="EVN">
                                        <code code="DE04.30.009.00" codeSystem="2.16.156.10011.2.2.1"
                                              codeSystemName="卫生信息数据元目录" displayName="辅助检查结果"></code>
                                        <value xsi:type="ST">${docData.shiYanSJC.fuZhuJCJG}</value>
                                    </observation>
                                </component>
                            </organizer>
                        </entry>
                    </#if>
                </section>
            </component>
            <!--用药章节 -->
            <component>
                <section>
                    <code code="10160-0" codeSystem="2.16.840.1.113883.6.1" displayName="HISTORY OF MEDICATION USE"
                          codeSystemName="LOINC"/>
                    <text/>
                    <entry>
                        <observation moodCode="EVN" classCode="OBS">
                            <code code="DE06.00.164.00" codeSystem="2.16.156.10011.2.2.1" displayName="中药类别代码"
                                  codeSystemName="卫生信息数据元目录"/>
                            <value code="${docData.yongYao.zhongYaoSYLB.code}" xsi:type="CD"
                                   codeSystem="2.16.156.10011.2.3.1.157"
                                   displayName="${docData.yongYao.zhongYaoSYLB.displayName}"
                                   codeSystemName="中药使用类别代码表"/>
                        </observation>
                    </entry>
                    <#if docData.yongYao.yongYaoItemList??>
                        <#list docData.yongYao.yongYaoItemList as item>
                            <entry>
                                <substanceAdministration moodCode="EVN" classCode="SBADM">
                                    <text/>
                                    <routeCode code="${item.yongYaoTJ.code}" codeSystem="2.16.156.10011.2.3.1.158"
                                               displayName="${item.yongYaoTJ.displayName}" codeSystemName="用药途径代码表"/>
                                    <doseQuantity unit="${item.danCiYYJL.unit}" value="${item.danCiYYJL.value}"/>
                                    <rateQuantity unit="${item.yaoWuSYPL.unit}" value="${item.yaoWuSYPL.value}"/>
                                    <consumable>
                                        <manufacturedProduct>
                                            <manufacturedLabeledDrug>
                                                <code/>
                                                <name>${item.yaoPinMC}</name>
                                            </manufacturedLabeledDrug>
                                        </manufacturedProduct>
                                    </consumable>
                                    <entryRelationship typeCode="COMP">
                                        <observation classCode="OBS" moodCode="EVN">
                                            <code code="DE06.00.027.00" codeSystem="2.16.156.10011.2.2.1"
                                                  codeSystemName="卫生信息数据元目录" displayName="用药观察"/>
                                            <!--服药依从性-代码 1 表示规律-->
                                            <value code="${item.fuYaoYCX.code}"
                                                   displayName="${item.fuYaoYCX.displayName}"
                                                   codeSystem="2.16.156.10011.2.3.2.12"
                                                   codeSystemName="服药依从性代码表" xsi:type="CD"/>
                                        </observation>
                                    </entryRelationship>
                                    <entryRelationship typeCode="COMP">
                                        <observation classCode="OBS" moodCode="EVN">
                                            <code code="DE06.00.129.00" codeSystem="2.16.156.10011.2.2.1"
                                                  codeSystemName="卫生信息数据元目录" displayName="药物不良反应标志"/>
                                            <!--用药副作用-文本-->
                                            <text>${item.yongYaoFZY}</text>
                                            <precondition>
                                                <criterion>
                                                    <!--用药副作用标志 value="true"表示有-->
                                                    <value xsi:type="BL" value="${item.yongYaoFZYBZ}"/>
                                                </criterion>
                                            </precondition>
                                        </observation>
                                    </entryRelationship>
                                    <entryRelationship typeCode="COMP">
                                        <observation classCode="OBS" moodCode="EVN">
                                            <code code="DE06.00.135.00" codeSystem="2.16.156.10011.2.2.1"
                                                  codeSystemName="卫生信息数据元目录" displayName="药物使用总剂量"/>
                                            <!-- 药物使用总剂量 -->
                                            <value unit="${item.yaoWuSYZJL.unit}" value="${item.yaoWuSYZJL.value}"
                                                   xsi:type="PQ"/>
                                        </observation>
                                    </entryRelationship>
                                </substanceAdministration>
                            </entry>
                        </#list>
                    </#if>
                </section>
            </component>
            <!-- 健康评估章节 -->
            <component>
                <section>
                    <code code="51848-0" displayName="Assessment note"
                          codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
                    <text/>
                    <!--条目：重性精神病随访评估[仅适用于重性精神病人群]-->
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE05.10.118.00" displayName="重性精神疾病患者随访评价"
                                  codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"/>
                            <value code="${docData.jianKangPG.suiFangPJ.code}"
                                   displayName="${docData.jianKangPG.suiFangPJ.displayName}"
                                   codeSystem="2.16.156.10011.2.3.2.37" codeSystemName="重性精神疾病患者随访评价结果代码表"
                                   xsi:type="CD"/>
                        </observation>
                    </entry>
                </section>
            </component>
            <!-- 健康指导章节 -->
            <component>
                <section>
                    <code code="69730-0" codeSystem="2.16.840.1.113883.6.1"
                          displayName="Instructions" codeSystemName="LOINC"/>
                    <text/>
                    <#if docData.jianKangZD.jingShenKFCSs??>
                        <#list docData.jianKangZD.jingShenKFCSs as item>
                            <entry>
                                <observation classCode="OBS" moodCode="DEF">
                                    <code code="DE06.00.060.00" codeSystem="2.16.156.10011.2.2.1"
                                          codeSystemName="卫生信息数据元目录"></code>
                                    <value code="${item.code}"
                                           displayName="${item.displayName}"
                                           codeSystem="2.16.156.10011.2.3.1.185" codeSystemName="精神康复措施代码表"
                                           xsi:type="CD"/>
                                </observation>
                            </entry>
                        </#list>
                    </#if>
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE06.00.066.00" codeSystem="2.16.156.10011.2.2.1" displayName="康复措施指导"
                                  codeSystemName="卫生信息数据元目录"></code>
                            <value xsi:type="ST">${docData.jianKangZD.kangFuCSZD}</value>
                        </observation>
                    </entry>
                </section>
            </component>
            <!--转诊建议章节-->
            <component>
                <section>
                    <code code="18776-1" codeSystem="2.16.840.1.113883.6.1" displayName="referal"
                          codeSystemName="LOINC"/>
                    <text/>
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE06.00.174.00" codeSystem="2.16.156.10011.2.2.1"
                                  codeSystemName="卫生信息数据元目录" displayName="转诊标志"/>
                            <value xsi:type="BL" value="${docData.zhuanZhenJY.zhuanZhenBZ}"></value>
                            <#if docData.zhuanZhenJY.zhuanZhenBZ=='true'>
                                <entryRelationship typeCode="CAUS" negationInd="false">
                                    <act classCode="INFRM" moodCode="APT" negationInd="false">
                                        <code code="DE06.00.177.00" codeSystem="2.16.156.10011.2.2.1"
                                              codeSystemName="卫生信息数据元目录" displayName="转诊原因"/>
                                        <text>${docData.zhuanZhenJY.zhuanZhenYY}</text>
                                        <performer>
                                            <time/>
                                            <assignedEntity>
                                                <id/>
                                                <representedOrganization>
                                                    <name>${docData.zhuanZhenJY.zhuanRuKSMC}</name>
                                                    <asOrganizationPartOf>
                                                        <wholeOrganization>
                                                            <name>${docData.zhuanZhenJY.zhuanRuJGMC}</name>
                                                        </wholeOrganization>
                                                    </asOrganizationPartOf>
                                                </representedOrganization>
                                            </assignedEntity>
                                        </performer>
                                    </act>
                                </entryRelationship>
                            </#if>
                        </observation>
                    </entry>
                </section>
            </component>
            <!--下次随访安排章节-->
            <component>
                <section>
                    <code displayName="下次随访日期"/>
                    <text/>
                    <entry>
                        <observation classCode="OBS" moodCode="DEF">
                            <code code="DE06.00.109.00" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"
                                  displayName="下次随访日期"/>
                            <value xsi:type="TS" value="${docData.xiaCiSFAP.xiaCiSFRQ}"/>
                        </observation>
                    </entry>
                </section>
            </component>
        </structuredBody>
    </component>
</ClinicalDocument>